import datetime
from datetime import time

schedule = [
    [time(8, 0), time(8, 50)],
    [time(9, 0), time(9, 50)],
    [time(10, 10), time(11, 0)],
    [time(11, 10), time(12, 0)],
    [time(14, 0), time(14, 50)],
    [time(15, 0), time(15, 50)],
    [time(16, 10), time(17, 0)],
    [time(17, 10), time(18, 0)],
    [time(18, 30), time(19, 20)],
    [time(19, 30), time(20, 20)],
    [time(20, 30), time(21, 20)],
]


def startIndex(t):
    for i, (a, b) in enumerate(schedule):
        if t == a:
            return i + 1, True
        elif t < b:
            return i + 1, False
    return 11, False


def endIndex(t):
    for i, (a, b) in enumerate(schedule):
        if t <= a:
            return i, False
        elif t == b:
            return i + 1, True
    return 11, False
